home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
VideoToolbox 96.06.15
/
VideoToolboxSources
/
DatedString.c
< prev
next >
Wrap
Text File
|
1994-06-03
|
973b
|
28 lines
/*
DatedString.c
returns a pointer to a string representing the time in a form suitable for
use as a unique filename extension, e.g. "890625015959", that
sorts in chronological order. The supplied time should be obtained by
calling Apple's GetDateTime() or Standard C's time().
Both return seconds since midnight January 1, 1904.
HISTORY:
1989 dgp wrote it.
2/25/94 dgp Noted above how to get the time.
3/19/94 dgp Removed the dots because the string was too long, using up nearly
the maximum length a filename.
5/28/94 dgp renamed from "DateString" to "DatedString" to avoid conflict with
Apple's Universal Headers. Thanks to Bob Dougherty
(wolfgang@cats.ucsc.edu) for reporting the incompatibility.
*/
#include "VideoToolbox.h"
char *DatedString(unsigned long seconds)
{
DateTimeRec t;
static char dateString[26];
Secs2Date(seconds,&t);
sprintf(dateString,"%02d%02d%02d%02d%02d%02d",t.year-1900,t.month,t.day,t.hour,t.minute,t.second);
return dateString;
}